FROM debian:buster

# TCP
EXPOSE 11002

# 安装 D语言编译器
RUN apt update && apt upgrade -y && \
    apt install -y libssl-dev wget libc6-dev libcurl4 gcc

RUN wget https://downloads.dlang.org/releases/2019/dmd_2.088.1-0_amd64.deb && \
    dpkg -i dmd_2.088.1-0_amd64.deb

# 设置工作目录
WORKDIR /app
 
COPY . .

RUN dub build -v

VOLUME /etc/privchat
WORKDIR /etc/privchat

# 定义容器启动时默认执行的命令
CMD ["/app/msgserver", "start", "/etc/privchat/msg2.json"]
